/*
 * $Id: FileInfo.java,v 1.3 2009/03/23 21:19:02 afaichun Exp $
 * 
 * Copyright (C) 2006 General Electric Company. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 * 
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */
package com.ge.healthcare.autosc.processor.iip.comm.vo;

/**
 * @author 212042764
 * 
 */
public class FileInfo {
	private int exitCode = -1;
	private String stdoutPath = null;
	private int stdoutSize = 0;
	private String stderrPath = null;
	private int stderrSize = 0;
	private boolean valid = false;
	public static final int VALID_ARG_SIZE = 5;

	/**
	 * Default constructor
	 */
	public FileInfo() {
		super();
	}

	/**
	 * @return the exitCode
	 */
	public int getExitCode() {
		return exitCode;
	}

	/**
	 * @param exitCode
	 *            the exitCode to set
	 */
	public void setExitCode(int exitCode) {
		this.exitCode = exitCode;
	}

	/**
	 * @return the name
	 */
	public String getStdoutPath() {
		return stdoutPath;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setStdoutPath(String name) {
		this.stdoutPath = name;
	}

	/**
	 * @return the size
	 */
	public int getStdoutSize() {
		return stdoutSize;
	}

	/**
	 * @param size
	 *            the size to set
	 */
	public void setStdoutSize(int size) {
		this.stdoutSize = size;
	}

	/**
	 * @return the stderrPath
	 */
	public String getStderrPath() {
		return stderrPath;
	}

	/**
	 * @param stderrPath
	 *            the stderrPath to set
	 */
	public void setStderrPath(String stderrPath) {
		this.stderrPath = stderrPath;
	}

	/**
	 * @return the stderrSize
	 */
	public int getStderrSize() {
		return stderrSize;
	}

	/**
	 * @param stderrSize
	 *            the stderrSize to set
	 */
	public void setStderrSize(int stderrSize) {
		this.stderrSize = stderrSize;
	}

	/**
	 * @return the valid
	 */
	public boolean isValid() {
		return valid;
	}

	/**
	 * @param valid
	 *            the valid to set
	 */
	public void setValid(boolean valid) {
		this.valid = valid;
	}

	public boolean isStdoutEmpty() {
		return (this.getStdoutSize() > 0)?false:true;
	}
	
	public boolean isStderrEmpty() {
		return (this.getStderrSize() > 0)?false:true;
	}
	
	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		StringBuffer definition = new StringBuffer();
		definition.append("{File Name=").append(this.getStdoutPath()).append(
				"},");
		definition.append("{Exit Code=").append(this.getExitCode())
				.append("},");
		definition.append("{File Size=").append(this.getStdoutSize()).append(
				"},");
		definition.append("{Std Error Path=").append(this.getStderrPath())
				.append("},");
		definition.append("{Std Err Size=").append(this.getStderrSize())
				.append("},");
		return definition.toString();
	}

}
